from flask import Flask, request, jsonify
from prompt import getMsg

app = Flask(__name__)


@app.route('/')
def hello_world():
    return jsonify({'a': 's'})


@app.route('/msg', methods=['GET', 'POST'])
def msg():
    print("==================", request.json)
    data = request.json['data']
    print("=======msg=====", data['msg'])
    res = getMsg(data['msg'])
    print("=======msg111=====", res)
    return jsonify({'data': res})


if __name__ == '__main__':
    app.run(host='0.0.0.0', port=90, debug=True)
